package com.storm.axactivity.splash;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.WindowManager;

import com.actionbarsherlock.view.Window;
import com.storm.axactivity.MainActivity;
import com.storm.axactivity.R;

public class splash extends Activity {
	private final int SPLASH_DISPLAY_LENGHT = 3000; // delay 3 seconds

	@Override
	public void onCreate(Bundle savedInstanceState) {

		// Don't need SherlockActivity title
		this.requestWindowFeature((int) Window.FEATURE_NO_TITLE);
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);

		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_splash);

		// delay
		new Handler().postDelayed(new Runnable() {
			@Override
			public void run() {
				Intent mainIntent = new Intent(splash.this, MainActivity.class);
				splash.this.startActivity(mainIntent);
				splash.this.finish();
			}

		}, SPLASH_DISPLAY_LENGHT);
	}
}
